package org.lcc.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.lcc.model.entity.Question;

import java.util.List;

@Mapper
public interface QuestionMapper {
    //批量导入试题
    int batchInsertQuestions(List<Question> questions);
    //创建单独试题
    void insertQuestion(Question question);
    //回显试题
    Question selectQuestion(@Param("questionId") Integer questionId);
    //修改试题
    void updateQuestion(@Param("question") Question question,@Param("questionId") Integer questionId);
    //批量/单独删除试题
    int deleteQuestions(@Param("questionIds") List<Integer> questionIds);
    //关键字模糊查询
    List<Question> searchQuestion(@Param("questionName") String questionName,@Param("type") String type,@Param("difficulty") String difficulty);
    //显示该题库所有试题（分页查询）
    List<Question> selectQuestionAll(@Param("questionName") String questionName,
                                     @Param("type") String type,
                                     @Param("difficulty") String difficulty,
                                     @Param("subject") String subject,
                                     @Param("keyword") String keyword);

}
